<template>
  <div id="app">
    <el-container style="display: flex">
      <el-aside width="200px" height="100%">
        <asideVue></asideVue>
      </el-aside>
      <el-main>
        <router-view v-if="isRouterAlive" />
      </el-main>
    </el-container>
  </div>
</template>

<script>
import asideVue from "@/components/index/aside";

export default {
  components: { asideVue },
  name: "App",
  provide() {
    return {
      reload: this.reload,
    };
  },
  data() {
    return {
      isRouterAlive: true,
    };
  },
  methods: {
    // 路由刷新不闪烁
    reload() {
      this.isRouterAlive = false;
      this.$nextTick(function () {
        this.isRouterAlive = true;
      });
    },
  },
  mounted() {},
};
</script>

<style>
#app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap-reverse;
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
a {
  text-decoration: none;
}
a:hover {
  color: rgb(22, 182, 129);
  cursor: pointer;
}

body > .el-container {
  margin-bottom: 40px;
}
.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}
</style>
